<!DOCTYPE html >
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>文章发布</title>

    <div th:include="common :: headcommon"></div>
    <script src="/js/index/article_pub.js" type="text/javascript"></script>
</head>
<body>
<div th:replace="common :: #top_start"></div>

<div class="layui-container container">
    <h2 class="page-title">新闻编辑</h2>
    <div class="layui-form layui-form-pane">
        <form action="#" method="post">
            <input type="hidden" name="id" th:value="${byId?.id}">
            <div class="layui-form-item">
                <label class="layui-form-label">标题</label>
                <div class="layui-input-block">
                    <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题"
                           class="layui-input" th:value="${byId?.title}">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                    <textarea id="content" name="content" lay-verify="content" placeholder="请输入内容"
                              class="layui-textarea layui-hide" th:utext="${byId?.content}"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">新闻分类</label>
                    <div class="layui-input-block">
                        <select name="cid" lay-verify="type">
                            <option value=""></option>
                            <option  th:value="${category.cid}"  th:each="category:${categories}" th:text="${category.cname}">写作</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <button class="layui-btn" type="button" lay-filter="public" lay-submit>提交</button>
                <a class="layui-btn" th:href="@{/index}">取消</a>
            </div>

<!--       <div class=""></div>-->
<!--            测试编辑器-->
<!--            <div class="site-demo-button" style="margin-top: 20px;">-->
<!--                <button class="layui-btn site-demo-layedit" data-type="content">获取编辑器内容</button>-->
<!--                <button class="layui-btn site-demo-layedit" data-type="text">获取编辑器纯文本内容</button>-->
<!--                <button class="layui-btn site-demo-layedit" data-type="selection">获取编辑器选中内容</button>-->
<!--            </div>-->

        </form>
    </div>
</div>
<div style="height: 50px;"></div>
<div th:replace="common :: #foot_start"></div>
</body>
</html>